<?php

function form_role_field_validate()
{
    return array(
        array(
            'field' => 'role_title',
            'rules' => 'required',
        ),
        array(
            'field' => 'role_name',
            'rules' => 'required',
        )
    );
}

function form_role_field($info = array())
{
    return array(
        'role_title' => array('name' => 'role_title',
            'class' => 'span3', 'value' => set_value('role_title', !empty($info) ? $info->role_title : '')),
        'role_name' => array('name' => 'role_name',
            'class' => 'span3', 'value' => set_value('role_name', !empty($info) ? $info->role_name : '')),
        'submit' => array('class' => 'btn btn-primary', 'data-loading-text' => 'Loading...',
            'value' => 'Save', 'name' => 'submit')
    );
}